Unit 4 Exercise 5
Exercise 5: Importing a Script
Objective
To import a script into the repository and create a job to run it.
Summary
In the Script Repository, import a script called ExerciseThreshold.cmd. Utilizing the existing schedule called Embedded Scripts Training, create a Job named ExerciseThreshold that runs the newly imported script.
Instructions
- In Library > Administration, select Scripts.
- Click Add.
- On the Add New Script page:
- In the Name field, enter
SetThreshold
- In the Type drop-down, select Command Shell.
- In the Description field, enter in some documentation.
- Verify that Role_ocadm is granted permissions.
- In the Comment box, leave Initial Version.
- In the Script field, click the Open File button.
- Navigate to the C:\scripts folder, select the ExerciseThreshold.cmd file and click Open.
- Click the Save button.
Create the Job
- In Library > Administration, select Master Schedules.
- Select Embedded Scripts Training and click View.
- Select Add Job in the side menu.
- In the Master Job Definition screen:
- In the Name textbox, enter
ExerciseThreshold
. - In the Job Type dropdown list, select Windows.
- In the Machine Selection dropdown list, select the SMATraining.
- In the User ID dropdown menu, select SMATRAINING\SMAUSER.
- In the Job Action dropdown list, select Embedded Script.
- In the Script dropdown list, select the SetThreshold.
- Leave the Version as LATEST (X).
- In the Runner dropdown menu, select Command Shell.
- In the Arguments textbox, type the following:
+2
- Click the Save button.
- Click the Lock icon in the upper right-hand corner.
- Give the Job a Frequency of Example-Mon-Fri-O.
- Click the Save button.
Validate the Initial Threshold Value
- Open Thresholds and check the current value of the TrainingThreshold. It should be
0
.
Build the Job
- In Processes, right-click on Embedded Scripts Training for today.
- Click the (+) icon in the side menu.
- In the Add Job pop-up window:
- Select Exercise Threshold and click the Next button.
- Change the Build Status to Released.
- Click the Next button.
- Click the Submit button.
- Close the Add Jobs results screen.
- Wait until the Job finishes OK.
- After the Job is finished, open the Thresholds tab and check the value. It must be
2
. - For practice, edit the Daily Job and change the value in the Arguments field to
0
, restart the Job and check the Threshold again.
note
The TrainingThreshold should have a value of 0 when this exercise is complete.